#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>

int main()
{
	for (int i = 10000; i < 99999; i++)
	{
		int sum = 0;
		for (int j = 1; j <= 4; j++)
		{
			sum += (i % (int)pow(10, j)) * (i / (int)pow(10, j));
		}
		if (sum == i)
			printf("%d\n", i);
	}
	return 0;
}